Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added UTs for GetAllTribes, GetTotalTribes & GetListedTribes #1555

Closed
wants to merge 10 commits into from

Conversation

hkarani
Copy link
Contributor

@hkarani hkarani commented Feb 22, 2024

Describe your changes

Issue ticket number and link

Issue number 1527
#1527

Type of change

Added test to tribes.go for GetAllTribes, GetListedTribes, GetTotalTribes

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist before requesting a review

  • I have performed a self-review of my code

rctx := chi.NewRouteContext()
tagVals := pq.StringArray{"tag1", "tag4", "tag7"}
tags := strings.Join(tagVals, ",")
rctx.URLParams.Add("tags", tags)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tags should be in URL query not Params

rctx := chi.NewRouteContext()
tagVals := pq.StringArray{}
tags := strings.Join(tagVals, ",")
rctx.URLParams.Add("tags", tags)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tags should be in URLQuery, not URLParams

@@ -10,12 +10,13 @@ func TribeRoutes() chi.Router {
r := chi.NewRouter()
tribeHandlers := handlers.NewTribeHandler(db.DB)
r.Group(func(r chi.Router) {
r.Get("/", handlers.GetListedTribes)
r.Get("/{tags}", tribeHandlers.GetListedTribes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the URL and add tags params to it, the tags come come the URL query.

@hkarani hkarani closed this Feb 24, 2024
@hkarani hkarani deleted the tribes-ut branch February 24, 2024 12:15
@hkarani
Copy link
Contributor Author

hkarani commented Feb 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants